﻿//SciChartLegend.xaml.cs
//Copyright (c) 2013 StockSharp LLC, all rights reserved.
//This code module is part of StockSharp library.
//This code is licensed under the GNU GENERAL PUBLIC LICENSE Version 3.
//See the file License.txt for the license details.
//More info on: http://stocksharp.com

namespace StockSharp.Xaml
{
	using System;
	using System.Collections.ObjectModel;
	using System.Windows.Media;

	using Ecng.Common;

	partial class SciChartLegend
    {
        private readonly ObservableCollection<LegendInfo> _legends = new ObservableCollection<LegendInfo>();

        public SciChartLegend()
        {
            InitializeComponent();
        }

        public ObservableCollection<LegendInfo> LegendItems
        {
            get { return _legends; }
        }
    }

    internal class LegendInfo
    {
        public LegendInfo(string title, Color color)
        {
	        if (title.IsEmpty())
		        throw new ArgumentNullException("title");

	        Title = title;
            Color = new SolidColorBrush(color);
        }

        public string Title { get; private set; }
		public Brush Color { get; private set; }
    }
}